|
Ant Farm - Robert Glen Martin School for the Talented and Gifted Dallas I.S.D. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectinfo.gridworld.actor.Actor
QueenAnt
public class QueenAnt
A QueenAnt sits around and waits for a
WorkerAnt to bring it food.
It does not act.
| Field Summary | |
|---|---|
private int |
foodQuantity
Total amount of food that the queen has received. |
| Constructor Summary | |
|---|---|
QueenAnt()
Constructs a QueenAnt actor. |
|
| Method Summary | |
|---|---|
void |
act()
"Do nothing" act method. |
void |
process(WorkerAnt ant)
Gets food from and gives current location to ant. |
java.lang.String |
toString()
Creates a string that describes this actor. |
| Methods inherited from class info.gridworld.actor.Actor |
|---|
getColor, getDirection, getGrid, getLocation, moveTo, putSelfInGrid, removeSelfFromGrid, setColor, setDirection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int foodQuantity
| Constructor Detail |
|---|
public QueenAnt()
QueenAnt actor.
The queen is colored magenta.
| Method Detail |
|---|
public void process(WorkerAnt ant)
ant.
process in interface Processableant - the calling WorkerAntpublic void act()
Cake, Cookie, and QueenAnt classes which do not act.
act in class info.gridworld.actor.Actorpublic java.lang.String toString()
toString in class info.gridworld.actor.ActorActor information
plus the amount of food given to this QueenAnt
|
© 2007 Robert Glen Martin. All rights reserved. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||